module.exports =
/******/ (function (modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if (installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
        /******/
      }
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
        /******/
      };
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
      /******/
    }
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function (exports, name, getter) {
/******/ 		if (!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
        /******/
      }
      /******/
    };
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function (exports) {
/******/ 		if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
        /******/
      }
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
  
    };

 	__webpack_require__.t = function (value, mode) {
 		if (mode & 1) value = __webpack_require__(value);
 		if (mode & 8) return value;
 		if ((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
 		var ns = Object.create(null);
 		__webpack_require__.r(ns);
 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
 		if (mode & 2 && typeof value != 'string') for (var key in value) __webpack_require__.d(ns, key, function (key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
      /******/
    };
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function (module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
      /******/
    };
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function (object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 0);
    /******/
  })
/************************************************************************/
/******/([
/* 0 */
/***/ (function (module, exports, __webpack_require__) {

        "use strict";


        /* eslint-disable */
        // 小程序开发api接口工具包，https://github.com/gooking/wxapi
    var API_BASE_URL = 'http://222.240.1.17:18888';
    var subDomain = 'CcLogisApp/api';
        var request = function request(url, needSubDomain, method, data) {
          var _url = API_BASE_URL + (needSubDomain ? '/' + subDomain : '') + url;
          
          return new Promise(function (resolve, reject) {
            wx.request({
              url: _url,
              method: method,
              data: data,
              header: {
                'Content-Type': 'application/x-www-form-urlencoded'
              },
              success: function success(request) {
                resolve(request.data);
              },
              fail: function fail(error) {
                reject(error);
              },
              complete: function complete(aaa) {
                // 加载完成
              }
            });
          });
          
        };

        /**
         * 小程序的promise增加finally方法
         */
        Promise.prototype.finally = function (callback) {
          var Promise = this.constructor;
          return this.then(function (value) {
            Promise.resolve(callback()).then(function () {
              return value;
            });
          }, function (reason) {
            Promise.resolve(callback()).then(function () {
              throw reason;
            });
          });
        };
        module.exports = {
          init2: function init2(a, b) {
            API_BASE_URL = a;
            subDomain = b;
          },
          init: function init(b) {
            subDomain = b;
          },
          request: request,
          getCarList: function getCarList(){
            return request('/alarm/getVehicleList/7799',true,'get')
          },
          getVehicleHistory: function getVehicleHistory(date) {
            return request('/alarm/vehicleHistory/7800', true, 'get', { date:date})
          },
          getAllDayTrack:function getAllDayTrack(vid,date){
            let startTime=`${date} 00:02:00`;
            let endTime=`${date} 11:00:00`;
            return request(`/allDayTrack/${vid}`,true,'get',{startTime:startTime,endTime:endTime})
          },
          getSubsectionTrackList:function getSubsectionTrackList(vid,date){
            return request(`/subsectionTrackList/${vid}`,true,'get',{date})
          },
          getSubTrack:function getSubTrack(vid,date){
            return request(`/subTrack/${vid}`,true,'get',{date})
          }
        };

        /***/
      })
/******/]);